package com.bw.controller;

import com.bw.pojo.User;
import com.bw.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/***************************
 FileAction:

 CreateTime:2022-07-25 14:30
 Author:Aaking-aline
 ****************************/
@Controller
public class UserController {

	@Autowired
	public UserService userService;


	@RequestMapping("/login")
	public String login(User user){
		boolean b = userService.login(user);
		if(b){
			return "message.html";
		}
		return "login.html?err";
	}

	@RequestMapping("/register")
	public String register(User user){
		boolean b = userService.register(user);
		if(b){
			return "login.html";
		}
		return "register.html";
	}

}
